package com.xiaoran.boot.config;

import com.xiaoran.boot.bean.Car;
import com.xiaoran.boot.bean.Cat;
import com.xiaoran.boot.bean.Stander;
import com.xiaoran.boot.bean.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;

@Configuration//告诉springboot这是配置类
//@ConditionalOnBean(name = "cat")
//@ImportResource("classpath:beans.xml")
@EnableConfigurationProperties(Car.class)

public class Configur {
    //@Bean
   public Cat cat(){
     return new Cat("小花");
    }
    @Bean
    public User user(){
        return new User("小冉",18);
    }

}
